<?php

/**
 * Milestoneversion form base class.
 *
 * @method Milestoneversion getObject() Returns the current form's model object
 *
 * @package    mysmartmanager
 * @subpackage form
 * @author     Your name here
 * @version    SVN: $Id: sfDoctrineFormGeneratedTemplate.php 24171 2009-11-19 16:37:50Z Kris.Wallsmith $
 */
abstract class BaseMilestoneversionForm extends BaseFormDoctrine
{
  public function setup()
  {
    $this->setWidgets(array(
      'versionid'   => new sfWidgetFormInputHidden(),
      'versioncode' => new sfWidgetFormInputText(),
      'milestoneid' => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('Milestone'), 'add_empty' => true)),
      'createdate'  => new sfWidgetFormDateTime(),
      'projectid'   => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('Project'), 'add_empty' => false)),
    ));

    $this->setValidators(array(
      'versionid'   => new sfValidatorDoctrineChoice(array('model' => $this->getModelName(), 'column' => 'versionid', 'required' => false)),
      'versioncode' => new sfValidatorInteger(array('required' => false)),
      'milestoneid' => new sfValidatorDoctrineChoice(array('model' => $this->getRelatedModelName('Milestone'), 'required' => false)),
      'createdate'  => new sfValidatorDateTime(array('required' => false)),
      'projectid'   => new sfValidatorDoctrineChoice(array('model' => $this->getRelatedModelName('Project'), 'required' => false)),
    ));

    $this->widgetSchema->setNameFormat('milestoneversion[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    $this->setupInheritance();

    parent::setup();
  }

  public function getModelName()
  {
    return 'Milestoneversion';
  }

}
